/*
 * Copyright 2009 Tran Nhut Trung.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License"); 
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 * http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, 
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and 
 * limitations under the License.
 */
package com.gdevelop.gwtxp.rebind;

import com.gdevelop.gwtxp.rebind.el.ELParserContext;

import com.google.gwt.core.ext.typeinfo.NotFoundException;
import com.google.gwt.user.rebind.SourceWriter;

import java.util.List;

import org.w3c.dom.Element;

public interface Tag {
  public void add(Tag tag);
  public Tag getParent();
  public List<Tag> getChildren();
  
  public void setVarName(String varName);
  public String getVarName();
  public Class getUIClass();
  
  public void setElement(Element elem);
  public Element getElement();
  
  public void setSourceWriter(SourceWriter out);
  public SourceWriter getSourceWriter();

  public void setELParserContext(ELParserContext ctx) throws NotFoundException;
  public ELParserContext getELParserContext();
  
  /**
   * Get additional imports required by this tag
   * @return
   */
  public String[] getImports();
  
  public void generateDeclaration() throws NotFoundException;
  public void generateInitStart() throws NotFoundException;
  public void generateInitEnd() throws NotFoundException;
  public void generateAddUI(Tag child) throws NotFoundException;
}
